package pkg461project;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author AJ
 */
public class DatabaseTest {

    public static void main(String[] args) {
        try {
            // Prepare a statement to insert a record
            String url = "jdbc:oracle:thin:@localhost:1521:xe";
            String user = "ajhallameyer";
            String password = "Aj101989";
            // Load the JDBC driver
            String driverName = "oracle.jdbc.driver.OracleDriver";
            Class.forName(driverName);

            Connection connection = DriverManager.getConnection(url, user, password);
            System.out.print("Connected successfully.\n");

            connection.close();
        } catch (SQLException e) {
            System.out.print("ERROR: " + e.getMessage());
        } catch (ClassNotFoundException e) {
            System.out.print("ERROR: " + e.getMessage());
        }
    }
}
